unit tests for the core functions.